package com.action.login;

import java.util.*;

import com.db.login.JoinManager;

public class testAction {
	private JoinManager join;
	private String id;
	private String pwd;
	private String pageResult;

	public String getPageResult() {
		return pageResult;
	}

	public void setPageResult(String pageResult) {
		this.pageResult = pageResult;
	}

	public JoinManager getJoin() {
		return join;
	}

	public void setJoin(JoinManager join) {
		this.join = join;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

	public String execute() throws Exception {

		Map map = new HashMap();
		map.put("l_id", id);
		map.put("l_pwd", pwd);

		join.isLogin(map);
		String l_result = "";
		l_result = (String) map.get("result");

		if (l_result.equals("ok")) {
			map.put("l_id", id);
			map.put("l_pwd", pwd);
			join.delete(map);
			pageResult = "ok";

		} else {
			pageResult = "fail";

		}

		return "success";
	}
}
